package com.monlyu.action.mail;

import com.monlyu.action.BaseAction;
import com.monlyu.annotation.ActionAnno;
import com.monlyu.bo.MailBo;
import com.monlyu.vo.Mail;

/********************************************************************************
 * 
 * <b>功能描述☞</b><br>
 * 
 * <b>开发公司☞</b>重庆唯尼科技有限公司<br>
 * <b>版权☞</b>本文件归重庆唯尼科技有限公司所有<br>
 * <b>项目名☞</b>NewsSys<br>
 * <b>文件路径☞</b>com.monlyu.action.mail.EditMailAction.java<br>
 * <b>开发日期☞</b>2010-2-24 <br>
 * 
 * @author zengjun
 * @since JDK 5
 * @version 1.0.8
 * 
 ********************************************************************************/
public class EditMailAction extends BaseAction {

	private Mail mail;
	
	private Long[] receiverIds;

	private MailBo mailBo;

	@ActionAnno(readOnly = false)
	public String execute() {
		mailBo.sendMail(mail,receiverIds);
		return redirect("mail/ListMail!sendedMail");
	}

	public Mail getMail() {
		return mail;
	}

	public void setReceiverIds(Long[] receiverIds) {
		this.receiverIds = receiverIds;
	}

	public void setMail(Mail mail) {
		this.mail = mail;
	}

	public void setMailBo(MailBo mailBo) {
		this.mailBo = mailBo;
	}

	@ActionAnno(readOnly = false)
	public String remove() {
		mailBo.remove(mail);
		return ajax();
	}

	@ActionAnno(readOnly = false)
	public String delete() {
		mailBo.deletMail(mail);
		return ajax();
	}

	@ActionAnno(readOnly = false)
	public String reset() {
		mailBo.reset(mail);
		return ajax();
	}

	public String home() {

		return view("mailHome.jsp");
	}

}
